package com.suxin.notify;

import com.suxin.notify.listener.Subscriber;

/**
 * @author Tang
 * @classname EventPublisher
 * @description [  ]
 * @date 2022/9/30 14:30
 */
public interface EventPublisher extends Closeable{

    /**
     * 初始化
     * @param type
     * @param bufferSize
     */
    void init(Class<? extends Event> type, int bufferSize);

    void addSubscribe(Subscriber subscriber);

    public void removeSubscribe(Subscriber subscriber);

    boolean publish(Event event);

    void notifySubscribe(Subscriber subscriber, Event event);

}
